﻿ <%--
  *  File:    FalsifySummary.jsp
  *  @Author: KevinFan
  *  Date:    2011/8/28
  *
  *  Copyright (C) 2000 - 2012 Oval Technologies, Inc.
  *  All rights reserved.
  *
  *  This software is the confidential and proprietary information of Oval
  *  Technologies, Inc. ("Confidential Information").  You shall not
  *  disclose such Confidential Information and shall use it only in
  *  accordance with the terms of the license agreement you entered into
  *  with Oval.
 --%>
<%@ page import="java.text.DecimalFormat" %>
<%@ page import="java.lang.*" %>
<%@ page contentType = "text/html;charset=UTF-8" %>

 <%
   Category cat = Category.getInstance("jsp.FalsifySummary");
   String strModuleName = "TDR";
   String privilegeCode = "A0602";
   String strTableName = "v_zylbusinessalesinfostock";
   String contextPath = request.getContextPath();
 %>
 <%@ include file="/inc/CommonHeader.inc" %>
 <%@ include file="/inc/OvalLocationDefault.inc" %>
 <%@ include file="/rpt/ReportURL.inc" %>
 <html>
 <iframe name="summaryfrm" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none;border:#909eff 1px solid;"></iframe>
 <head>
 <title>CustomerCollateEdit</title>
 <PageFlow:CheckPageFlow pageName="p_getchuanhuosummary"/>
 <%@ include file="/inc/CatchError.inc" %>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
 <script language="JavaScript" src="<%=contextPath %>/js/SummaryDivision.js"></script>
 <link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
 <script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
 <script language="JavaScript" src="<%=contextPath %>/js/Calendar.js"></script>
 <script language="JavaScript" src="<%=contextPath %>/js/FuncLib.js"></script>
 <script language="JavaScript" src="<%=contextPath %>/js/opal2/mootools.js"></script>
 <%@ include file="/inc/SummaryDivision.inc" %>
 <%@ include file="/inc/NewCalendar.inc" %>
 <%
   Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
   HashMap userinfo = (HashMap)session.getAttribute("userinfo");
   String isconfirm = (String)pageContext.getAttribute("isconfirm");
   String userid = (Integer) userinfo.get("userid")+"";
  // String  issalesman = (String) userinfo.get("issalesman");
   if(totalsummary == null)totalsummary = new Vector();
 %>
<script>
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "FalsifySummary.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function page_download(){
    var id = <%=userinfo.get("userid")%>;
	chuanruoffice = document.cform.chuanruoffice.value;	
	customername =document.cform.customername.value;
	applyusername =document.cform.applyusername.value;
	createdate1 = document.cform.createdate1.value;
	createdate2 =document.cform.createdate2.value;
	chuanchuoffice= document.cform.chuanchuoffice.value;
	outsellername = document.cform.outsellername.value;
	employeeid = document.cform.maker.value;
	batchno = document.cform.batchno.value;
	confirmoutseller2name = document.cform.confirmoutseller2name.value;
	isconfirm = document.cform.isconfirm.value;
	if(isconfirm=="N")isconfirm="";
strHref = "<%= reportURL %>/servlet/ExcecuteReport/ChuanHuoApplyData.sox?__format=xlsx&__folder=/ovalreport&rownum=2&employeeid="+id+"&chuanruoffice="+escape(encodeURI(chuanruoffice))+"&customername="+escape(encodeURI(customername))+"&applyusername="+escape(encodeURI(applyusername))+"&createdate1="+createdate1+"&createdate2="+createdate2+"&chuanchuoffice="+escape(encodeURI(chuanchuoffice))+"&outsellername="+escape(encodeURI(outsellername))+"&batchno="+batchno+"&confirmoutseller2name="+escape(encodeURI(confirmoutseller2name))+"&isconfirm="+isconfirm;
 	window.open(strHref);
	
 }


function page_download1(){
    var id = <%=userinfo.get("userid")%>;
	chuanruoffice = document.cform.chuanruoffice.value;	
	customername =document.cform.customername.value;
	applyusername =document.cform.applyusername.value;
	createdate1 = document.cform.createdate1.value;
	createdate2 =document.cform.createdate2.value;
	chuanchuoffice= document.cform.chuanchuoffice.value;
	outsellername = document.cform.outsellername.value;
	employeeid = document.cform.maker.value;
	batchno = document.cform.batchno.value;
	confirmoutseller2name = document.cform.confirmoutseller2name.value;
	isconfirm = document.cform.isconfirm.value;
	if(isconfirm=="N")isconfirm="";
	strHref = "<%= reportURL %>/csv?__report=/ovalreport/ChuanHuoApplyData.txt&rownum=2&employeeid="+id+"&chuanruoffice="+escape(encodeURI(chuanruoffice))+"&customername="+escape(encodeURI(customername))+"&applyusername="+escape(encodeURI(applyusername))+"&createdate1="+createdate1+"&createdate2="+createdate2+"&chuanchuoffice="+escape(encodeURI(chuanchuoffice))+"&outsellername="+escape(encodeURI(outsellername))+"&batchno="+batchno+"&confirmoutseller2name="+escape(encodeURI(confirmoutseller2name))+"&isconfirm="+isconfirm;
	
 	window.open(strHref);
	
 }
 
 
 
 function page_excel(){
    isbig=1;
    
	chuanruoffice = document.cform.chuanruoffice.value;	
	customername =document.cform.customername.value;
	applyusername =document.cform.applyusername.value;
	createdate1 = document.cform.createdate1.value;
	createdate2 =document.cform.createdate2.value;
	chuanchuoffice= document.cform.chuanchuoffice.value;
	outsellername = document.cform.outsellername.value;
	employeeid = document.cform.maker.value;
	batchno = document.cform.batchno.value;
	confirmoutseller2name = document.cform.confirmoutseller2name.value;
	isconfirm = document.cform.isconfirm.value;
	if(isconfirm=="N")isconfirm="";
	strHref = "<%= reportURL %>/servlet/ExcecuteReport/ChuanHuoApplyDatabig.sox?__folder=/ovalreport&rownum=2&chuanruoffice="+escape(encodeURI(chuanruoffice))+"&customername="+escape(encodeURI(customername))+"&applyusername="+escape(encodeURI(applyusername))+"&createdate1="+createdate1+"&chuanchuoffice="+escape(encodeURI(chuanchuoffice))+"&outsellername="+escape(encodeURI(outsellername))+"&batchno="+batchno+"&confirmoutseller2name="+escape(encodeURI(confirmoutseller2name))+"&isconfirm="+isconfirm+"&isbig="+isbig;
	window.open(strHref); 	
 }
 
 
 
function page_clear(){
	cform.chuanruoffice.value = "";	
	cform.customername.value = "";
	cform.applyusername.value = "";
	cform.createdate1.value = "";
	cform.createdate2.value = "";
	cform.chuanchuoffice.value = "";
	cform.outsellername.value = "";
	cform.maker.value = "";
	cform.batchno.value = "";
	cform.confirmoutseller2name.value = "";
}
</script>
 </head>
 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
 <iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
 <form name="cform" method="post" action="<%=contextPath %>/Dispatcher"> 
	<input type="hidden" name="pagename" value="p_getchuanhuosummary">
    <input type="hidden" name="actionname"/>
	<input type="hidden" name="isfirst" value="N"/>
	<input type="hidden" name="maker" value="<custom:write property="userid" name="userinfo" scope="session"/>"/>
	<custom:hidden property="isconfirm"/>
 <%-- page location --%>
   <%@ include file="/inc/PageLocation.inc" %>
	   <table width="100%" cellspacing="0" cellpadding="0" border="0">
			<tr>
            <td>
			  <table width="100%" border="0" cellspacing="0" onkeydown="if(event.keyCode==13) page_summary('search');" >
				<tr>
                         <td class="td_right" width="8%"><%= "窜入方办事处" + label.getLabelName("L_Colon") %></font></td>
                         <td class="td_left" width="10%">
                            <custom:text property="chuanruoffice" size="15" />
                         </td>			 
						 <td class="td_right" width="11%"><%= "窜入商业/终端名称" + label.getLabelName("L_Colon") %></td>
                         <td class="td_left" width="10%">
                             <custom:text property="customername" size="15" />
                         </td>
						 <td class="td_right" width="12%"><%= "申请人姓名" + label.getLabelName("L_Colon") %></td>
                         <td class="td_left" width="10%">
                             <custom:text property="applyusername" size="15" />
                         </td>
                         <td class="td_right" width="7%"><%="上载日期" +  label.getLabelName("L_Colon") %></td>
						 <td class="td_left" width="*%">
							<custom:text property="createdate1" size="10" />
							<a onclick="javascript:c.show(this,'cform.createdate1','yyyy-MM-dd')"><input type=button class="button3" value="*"></a>--
							<custom:text property="createdate2" size="10" />
							<a onclick="javascript:c.show(this,'cform.createdate2','yyyy-MM-dd')"><input type=button class="button3" value="*"></a>
							&nbsp;&nbsp;
							<button type="button" onclick="page_clear()" class="button1" name="re" value="clear" style="width:60"><%=label.getLabelName("L_Clear") %>
						 </td> 
                       </tr>
<%-----------------------第二行---------------------%>
                       <tr>
                         <td class="td_right"><%= "窜出方办事处" + label.getLabelName("L_Colon") %></td>
                         <td class="td_left">
                            <custom:text property="chuanchuoffice" size="15" />
						 </td>
						 <td class="td_right"><%= "窜出方实际配送商业名称" + label.getLabelName("L_Colon") %></td>
                         <td class="td_left">
                             <custom:text property="confirmoutseller2name" size="15" />
                         </td>
						 <td class="td_right"><%= "窜出方商业/终端名称" + label.getLabelName("L_Colon") %></td>
                         <td class="td_left">
                             <custom:text property="outsellername" size="15" />
                         </td>
						 <td class="td_right"><%= "批号" +  label.getLabelName("L_Colon") %></td>
						 <td class="td_left">
							<custom:text property="batchno" size="15" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							<%= "已批复" +  label.getLabelName("L_Colon") %>
							<input type="checkbox" name="checkflag" onclick="page_setConfirm()" class="checkbox">&nbsp;&nbsp;
							<a href="javascript:page_summary('search')"><img src="/oval/images/cn/go.gif" border="0" ></a>
						 </td>
							</tr>
						  </table></td>
                       </tr>
			  </table>
			</td>
           </tr>        
           <tr>
             <td colspan="2">
			  <div style="width:100%;height=420;overflow=auto;">
			  <table width="300%" border="1" cellspacing="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellpadding="0" width="100%">
				<tr class="deepblue-left">
					<td class="title_center" ><%= label.getLabelName("L_ProductCode")%></td>           
					<td class="title_center" ><%= label.getLabelName("L_ProdName")%></td>               
					<td class="title_center" ><%= label.getLabelName("L_ChuanRuOffice")%></td>   
					<td class="title_center" ><%= label.getLabelName("L_ApplyUserCode")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ApplyUserName")%></td>
					<td class="title_center" ><%= label.getLabelName("L_DeptName")%></td>
					<td class="title_center" ><%= label.getLabelName("L_CustomerCodeF")%></td>
					<td class="title_center" ><%= label.getLabelName("L_CustomerNameF")%></td> 
					<td class="title_center" ><%= label.getLabelName("L_LotNumber")%></td>
					<td class="title_center" ><%= label.getLabelName("L_PassWordSupervis")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ChuanRuQty")%></td>              
					<td class="title_center" ><%= label.getLabelName("L_UnitPrice")%></td>
					<td class="title_center" ><%= label.getLabelName("L_Amount")%></td>
					<td class="title_center" ><%= label.getLabelName("L_BuyTime")%></td>
					<td class="title_center" ><%= label.getLabelName("L_LocalSellerCode")%></td>
					<td class="title_center" ><%= label.getLabelName("L_LocalSellerName")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ChuanChuOffice")%></td>
					<td class="title_center" ><%= label.getLabelName("L_OutSellerCode")%></td>
					<td class="title_center" ><%= label.getLabelName("L_OutSellerName")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ProofDesc")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ProofCode")%></td>
					<td class="title_center" ><%= label.getLabelName("L_Whether_In_Cuanhuo")%></td>
					<td class="title_center" ><%= label.getLabelName("L_UploadDate")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmQty")%></td>
					<td class="title_center" ><%= label.getLabelName("L_RejectDesc")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmOutSellerCode")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmOutSellerName")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmOutSeller2Code")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmOutSeller2Name")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmCustomerCode")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmCustomerName")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmMkerCode")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmMkerName")%></td>
					<td class="title_center" ><%= label.getLabelName("L_ConfirmPrice")%></td>
				</tr>
				<%
					String strClassType = "";
				%>
				<logic:iterate id="totalsummaryinfo" collection="<%= totalsummary %>"  indexId="idx">
				<%
				  HashMap totalmap = (HashMap)pageContext.getAttribute("totalsummaryinfo");
				  if((idx.intValue())%2 == 1)
				  {
						strClassType = "td-listrom";
				  }else{
						strClassType = "";
				  }
				%>
				<tr onMouseOver="this.className='tr-over'" onMouseOut="this.className='<%=JspHelper.filterNull( strClassType )%>'"  class="<%=JspHelper.filterNull( strClassType )%>">
					<td><custom:write property="productcode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="productname" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="chuanruoffice" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="applyusercode" name="totalsummaryinfo" nbsp="true"/></td> 
					<td><custom:write property="applyusername" name="totalsummaryinfo" nbsp="true"/></td>          
					<td><custom:write property="deptnames" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="customercode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="customername" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="batchno" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="datacode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="qty" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="price" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="amount" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="buydate" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="localsellercode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="localsellername" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="chuanchuoffice" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="outsellercode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="outsellername" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="proofdesc" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="proofcode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="isin" name="totalsummaryinfo" dictType="YesOrNo" nbsp="true" /></td>
					<td><custom:write property="createdate" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmqty" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="rejectdesc" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmoutsellercode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmoutsellername" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmoutseller2code" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmoutseller2name" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmcustomercode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmcustomername" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmapplyusercode" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmapplyusername" name="totalsummaryinfo" nbsp="true"/></td>
					<td><custom:write property="confirmprice" name="totalsummaryinfo" nbsp="true"/></td>
				</tr>
				</logic:iterate>
				<%@ include file="/inc/SummaryAction.inc" %>
			</table>
			</div>
		</td>		
	</tr>
	<tr>
		<table width="100%" cellspacing="0" cellpadding="0" border="0">
		<tr>
				
		<td class="td_center" colspan="10">
		<td class="td_center">
          	<a onclick="page_excel();"><custom:button type="1" label="L_Big" imgsrc="Modify.gif" border="0" style="width:100" privilegeCode="MB-CHCX04"/></a>&nbsp;
            </td>
		   <%if(totalsummary.size()!=0){%>
		   <custom:button label="L_Upload" styleClass="button1" style="width:80px;" onclick="page_upload()" privilegeCode="MB-CHCX03"/>&nbsp;&nbsp;
		   <custom:button styleClass="button1" label="L_Download" style="width:80" onclick="page_download()" privilegeCode="MB-CHCX02"/>
			 <custom:button styleClass="button1" label="L_ExportCSV" style="width:80" onclick="page_download1()" privilegeCode="MB-CHCX02"/>
		   <%}%>
		</td>

			
		</tr>
		</table>
	</tr>
</table>
</form>	
<script>
	function page_setConfirm(){
		if(cform.checkflag.checked){
			cform.isconfirm.value = 'Y';
		}else{
			cform.isconfirm.value = 'N';
		}
	}
	<%if("Y".equals(isconfirm)){%>
		   cform.checkflag.checked = true;
	<%}%>
	function page_upload(){
		this.location.href = "<%= contextPath%>/phap/masterdata/spm/uploadInc/UploadTempChuanHuoReply.jsp?first=A&second=A06&third=A0601&languagecode=cn&<%= OvalTools.randomURL() %>";
	}
</script>
</body>
</html>


